﻿<?xml version="1.0" encoding="utf-8" ?>
<c2eventsheet>
    <!--All the 'name' attributes are ignored by Construct 2 - they are there for readability only.-->
    <name>Safari Audio Title events</name>
    <events>
        <comment>Center the title text on the screen.</comment>
        <event-block sid="472">
            <conditions>
                <condition id="-1" name="Every tick" sid="397" type="System" />
            </conditions>
            <actions>
                <action id="-3" name="Set position" sid="398" type="SafariTitle">
                    <param id="0" name="X">(ViewportLeft(0) + ViewportRight(0)) / 2</param>
                    <param id="1" name="Y">(ViewportTop(0) + ViewportBottom(0)) / 2</param>
                </action>
            </actions>
        </event-block>
        <comment>Safari for iOS does not play audio until you attempt to play a sound in a touch start event.  Therefore, this screen serves to get the user to touch the screen, where we play a sound. If the user is not on a mobile device, just skip this step and immediately jump to the title screen.</comment>
        <event-block any="1" sid="473">
            <conditions>
                <condition id="-20" inverted="1" name="Is on mobile device" sid="399" type="System" />
                <condition id="-8" name="Compare two values" sid="400" type="System">
                    <param id="0" name="First value">find(Browser.UserAgent, &quot;Safari&quot;)</param>
                    <param id="1" name="Comparison">0</param>
                    <param id="2" name="Second value">-1</param>
                </condition>
            </conditions>
            <actions>
                <action id="-2" name="Go to layout" sid="401" type="System">
                    <param id="0" name="Layout">Title</param>
                </action>
            </actions>
        </event-block>
        <event-block sid="474">
            <conditions>
                <condition id="0" name="On any touch start" sid="402" type="Touch" />
            </conditions>
            <actions>
                <action id="0" name="Play" sid="403" type="Audio">
                    <param id="0" name="Audio file">SquareMotif1</param>
                    <param id="2" name="Loop">0</param>
                    <param id="3" name="Volume">0</param>
                    <param id="1" name="Tag (optional)">&quot;&quot;</param>
                </action>
                <action id="-2" name="Go to layout" sid="404" type="System">
                    <param id="0" name="Layout">Title</param>
                </action>
            </actions>
        </event-block>
        <comment>Get the sound loading on startup so it plays straight away.</comment>
        <event-block sid="475">
            <conditions>
                <condition id="-2" name="On start of layout" sid="405" type="System" />
            </conditions>
            <actions>
                <action id="4" name="Preload" sid="406" type="Audio">
                    <param id="0" name="Audio file">SquareMotif1</param>
                </action>
            </actions>
        </event-block>
    </events>
</c2eventsheet>
